import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 强仔
 * Date: 2022-08-30
 * Time: 15:31
 */
public class Main {

    // 1. 电话号码的转换
    public static void mainO(String[] args) {

        String letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        String number = "22233344455566677778889999";
        Map<Character, Character> map = new HashMap<>();
        for (int i = 0; i < 26; i++) {
            char key = letter.charAt(i);
            char value = number.charAt(i);
            map.put(key, value);
        }


        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {

            int n = scanner.nextInt();
            scanner.nextLine();
            String[] phones = new String[n];
            for (int i = 0; i < n; i++) {
                phones[i] = scanner.nextLine();
            }

            PriorityQueue<String> queue = new PriorityQueue<>();

            for (int i = 0; i < n; i++) {
                String p = phones[i];
                StringBuilder s = new StringBuilder();

                for (int j = 0; j < p.length(); j++) {
                    char ch = p.charAt(j);
                    if (ch >= '0' && ch <= '9') {
                        s.append(ch);
                    } else if (ch >= 'A' && ch <= 'Z') {
                        s.append(map.get(ch));
                    }

                    if (s.length() == 3) {
                        s.append('-');
                    }
                }

                queue.offer(s.toString());
            }


            String pre = null;
            while (!queue.isEmpty()) {
                String res = queue.poll();
                if(!res.equals(pre)){
                    System.out.println(res);
                }
                pre = res;
            }

            System.out.println();
        }
    }

    // 2. 求和
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        List<List<Integer>> res = new ArrayList<>();
        getAdd(res, new ArrayList<>(), 0, 0, m, n);

        for (List<Integer> l : res) {
            for (int val : l) {
                if(val == 0){
                    continue;
                }
                System.out.print(val + " ");
            }
            System.out.println();
        }
    }

    public static boolean getAdd(List<List<Integer>> res, List<Integer> list, int val, int num, int m, int n){
        num += val;
        if(num > m){
            return true;
        }

        list.add(val);
        if(num == m){
            List<Integer> newList = new ArrayList<>(list);
            res.add(newList);

            list.remove(list.size() - 1);
            return true;
        }

        for (int i = val + 1; i <= n; i++) {
            boolean book = getAdd(res, list, i, num, m, n);
            if(book){
                break;
            }
        }

        list.remove(list.size() - 1);
        return false;

    }
}
